package com.taobao.wolfwolf.hibernate.pojo;

public class Shopper implements java.io.Serializable {

	private static final long serialVersionUID = -3098583033666602440L;
	
	private Integer id;
	private String name;
	private Integer credit;
	private Integer favour;
	private Integer quantity;
	private String date;

	public Shopper() {
	}

	public Shopper(String name, Integer credit, Integer favour,
			Integer quantity, String date) {
		this.name = name;
		this.credit = credit;
		this.favour = favour;
		this.quantity = quantity;
		this.date = date;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getCredit() {
		return this.credit;
	}

	public void setCredit(Integer credit) {
		this.credit = credit;
	}

	public Integer getFavour() {
		return this.favour;
	}

	public void setFavour(Integer favour) {
		this.favour = favour;
	}

	public Integer getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public String getDate() {
		return this.date;
	}

	public void setDate(String date) {
		this.date = date;
	}
	
	@Override
	public boolean equals(Object obj) {
		Shopper tmp = (Shopper) obj;
		String d1, d2;
		d1 = this.getDate().substring(0, 10).trim();
		d2 = tmp.getDate().substring(0, 10).trim();
		
		if(!d1.equals(d2)) {
			return false;
		}
		return true;
	}
}